<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class MaintainOrder extends Model
{
    use HasDateTimeFormatter;
    use SoftDeletes;
    protected $table = 'maintain_order';

    const IS_REPLACE_MAINTAIN = [
        0 => '否',
        1 => '是',
    ];

    const ORDER_STATUS = [
        0 => '待分配',
        1 => '待维修',
        2 => '待验收',
        3 => '已验收',
    ];

    public function applyuser()
    {
        return $this->belongsTo(User::class,'apply_user','id');
    }

    public function maintainuser()
    {
        return $this->belongsTo(User::class,'maintain_user','id');
    }

    public function audituser()
    {
        return $this->belongsTo(User::class,'audit_user','id');
    }

}
